package simulation;
import java.util.List;

import util.Vector;

public class Gravity extends Force{
	
	private Vector myVector;

	private static final double DEFAULT_ANGLE = 90;
	private static final double DEFAULT_MAGNITUDE = 10;
	private static final String DEFAULT_NAME = "Gravity";
	
	public Gravity(){
		this(DEFAULT_ANGLE,DEFAULT_MAGNITUDE);
	}
	public Gravity(double angle, double magnitude){
		super(DEFAULT_NAME);
		myVector=new Vector(angle,magnitude);
	}
	
	public void apply(List<Mass> Masses){
		if (!isOn()) 
			return;
		for (Mass m : Masses){
			m.applyForce(myVector);
		}	
	}
}
